home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.text;
-
- import java.awt.Component;
- import java.awt.event.ActionEvent;
-
- class DefaultEditorKit$NextWordAction extends TextAction {
- private boolean select;
-
- DefaultEditorKit$NextWordAction(String nm, boolean select) {
- super(nm);
- this.select = select;
- }
-
- public void actionPerformed(ActionEvent e) {
- JTextComponent target = ((TextAction)this).getTextComponent(e);
- if (target != null) {
- try {
- int offs = target.getCaretPosition();
- offs = Utilities.getNextWord(target, offs);
- if (this.select) {
- target.moveCaretPosition(offs);
- } else {
- target.setCaretPosition(offs);
- }
- } catch (BadLocationException var4) {
- ((Component)target).getToolkit().beep();
- }
- }
-
- }
- }
-